package com.server.admin.Impl;

import com.dao.db1.admin.AdminButtonDao;
import com.dao.db1.admin.AdminMenuDao;
import com.pojo.Button;
import com.server.admin.AdminButtonServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminButtonServerImpl implements AdminButtonServer {
    private AdminButtonDao adminButtonDao;

    @Autowired
    public AdminButtonServerImpl(AdminButtonDao adminButtonDao) {
        this.adminButtonDao = adminButtonDao;
    }

    @Override
    public List<Button> selectAdminButtonRoleIdMenuAll(int roleId) {
        return adminButtonDao.selectAdminButtonRoleIdMenuAll(roleId);
    }

    @Override
    public List<Button> selectAdminButtonRoleIdMenu(int roleId) {
        return adminButtonDao.selectAdminButtonRoleIdMenu(roleId);
    }

    @Override
    public List<Button> selectAdminButton(String buttonId, String buttonFunction, int limit, int page) {
        return adminButtonDao.selectAdminButton(buttonId,buttonFunction,limit,page);
    }

    @Override
    public int getAutoId() {
        return adminButtonDao.getAutoId();
    }

    @Override
    public int insertAdminButton(int buttonId, String buttonName, String remark, String buttonFunction, int menuId, String operationType) {
        return adminButtonDao.insertAdminButton(buttonId,buttonName,remark,buttonFunction,menuId,operationType);
    }

    @Override
    public int updateAdminButton(int buttonId, String buttonName, String remark, String buttonFunction, int menuId, String operationType) {
        return adminButtonDao.updateAdminButton(buttonId,buttonName,remark,buttonFunction,menuId,operationType);
    }

    @Override
    public int deleteAdminButton(int buttonId) {
        return adminButtonDao.deleteAdminButton(buttonId);
    }

    @Override
    public int deleteAdminRoleMenuButton(int roleId) {
        return adminButtonDao.deleteAdminRoleMenuButton(roleId);
    }

    @Override
    public int insertAdminRoleMenuButton(int roleId, int menuId, int buttonId) {
        return adminButtonDao.insertAdminRoleMenuButton(roleId,menuId,buttonId);
    }
}
